package cn.tedu.exam.generator;

/**
 * 战舰类
 */
public class HeroShip {
    //战舰名
    String name;
    //速度
    int speed;
    //坐标
    int x;
    //坐标
    int y;

    //（非静态方法）随着对象的创建而创建,对象专属，通过对象调用
    //发射子弹
    public void shoot(){

    }

    //（静态方法）随着类的加载而加载，类专属，通过类调用
    //移动
    public static void move(){

    }


    //无参构造方法
    public HeroShip(){
    }

    //有参构造方法
    public HeroShip(String name,int s, int x, int y ){
        this.name = name;
        this.speed = s;
        this.x = x;
        this.y = y;
    }

    /**
     * 入口函数
     * @param args
     */
    public static void main(String[] args) {
        //创建辽宁号
        HeroShip ship1 = new HeroShip();
        ship1.shoot();
        //创建山东舰
        HeroShip ship2 = new HeroShip();
        ship2.shoot();
        //创建南宁号
        HeroShip ship3 = new HeroShip("南宁号",35,116,20);
        ship3.shoot();
        //通过类调用
        HeroShip.move();

        ship1.move();
        ship2.move();
        ship3.move();
    }




}
